import Relay from "react-relay";

export default class HistoryEnquiryOrderMutation extends Relay.Mutation {

    static fragments = {};

    getMutation() {
        return Relay.QL`mutation { historyEnquiryOrder }`;
    }

    getVariables() {
        return {
            argsInput: {
                orderId: this.props.orderId,
                pageSize: this.props.pageSize,
                pageNum: this.props.pageNum
            }
        };
    }

    getFatQuery() {
        return Relay.QL`fragment on historyEnquiryOrderPayload {
            historyEnquiryOrder {
                errorCode
                value
                totalResult
                id
                orders{
                     oid
                     versionDesc
                     createDate
                     enquiryId
                }
            }
        }`;
    }

    getConfigs() {
        return [{
            type: 'REQUIRED_CHILDREN',
            children: [Relay.QL`
               fragment on historyEnquiryOrderPayload {
                    historyEnquiryOrder {
                        errorCode
                        value
                        totalResult
                        id
                        orders{
                            oid
                            versionDesc
                            createDate
                            enquiryId
                        }
                    }
               }
            `]
        }];
    }

}
